package com.example.leetcode.graph;

import com.example.leetcode.array.common.ArrayUtils;
import com.example.leetcode.graph.common.GraphUtils;

import java.util.Arrays;
import java.util.List;

class Solution1203 {
    public int[] sortItems(int n, int m, int[] group, List<List<Integer>> beforeItems) {
        return GraphUtils.sortItems(n, m, group, beforeItems);
    }
}

public class leetcode1203 {
    public static void main(String[] args) {
        Solution1203 solution1203 = new Solution1203();
        int n = 8;
        int m = 2;
        int[] group = {-1, -1, 1, 0, 0, 1, 0, -1};
        int[][] beforeItems = {{}, {6}, {5}, {6}, {3, 6}, {}, {}, {}};
        System.out.println(Arrays.toString(solution1203.sortItems(n, m, group, ArrayUtils.convertArrayToList(beforeItems))));
    }
}
